/**
 * 
 */
package it.battlehorse.scripting.mapping;

import it.battlehorse.scripting.registry.IScriptingRegistry;

import org.eclipse.core.runtime.IConfigurationElement;


/**
 * Implementations of this interface provides mapping functionalities between scripted contributions and
 * standard eclipse contributions. The latters will act as wrappers for the formers.
 * 
 * @author battlehorse
 *
 */
public interface IContributionMapper {
	
	/**
	 * Returns a valid xml string which defines the eclipse contribution which wraps the
	 * scripted contribution passed as parameter.
	 * 
	 * @param el the configuration element associated with the scripted contribution
	 * @return a valid xml string which defines the eclipse wrapper contribution
	 */
	public String getContribution(IConfigurationElement el);
	
	/**
	 * Returns the id of the eclipse wrapper contribution
	 * 
	 * @param el the configuration element associated with the scripted contribution
	 * @return the id of the eclipse wrapper contribution
	 */
	public String getContributionId(IConfigurationElement el);
	
	/**
	 * This callback method allows the contribution mapper to update the scripting registry about newly
	 * registered scripts.
	 * 
	 * @param registry the scripting registry
	 * @param el the configuration element associated with the scripted contribution
	 */
	public void updateScriptingRegistry(IScriptingRegistry registry,IConfigurationElement el);
	
}
